home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Business Master (4th Edition)
/
The Business Master - 4th Edition.iso
/
files
/
utilstem
/
ubelt
/
belt.doc
< prev
next >
Wrap
Text File
|
1992-02-09
|
86KB
|
2,238 lines
=========
=============================== U t i l i t y
= ====o o o o
=============================== B e l t v1.1a
=========
Shareware Utility Collection
Copyright 1990, 1991, 1992
Herne Data Systems Ltd.
PO Box 250
Tiverton, ON N0G 2T0
CANADA
voice or FAX (519) 366-2732
CompuServe 72060,1153
Software worth hunting for!
TABLE OF CONTENTS
SHAREWARE REGISTRATION FORM . . . . . . . . . . . . . . . . . ii
THE FINE PRINT . . . . . . . . . . . . . . . . . . . . . . . iii
DISCLAIMER - AGREEMENT . . . . . . . . . . . . . . . . iii
REGISTRATION BENEFITS . . . . . . . . . . . . . . . . . iv
REGISTRATION AND CUSTOMER SUPPORT ADDRESS . . . . . . . iv
ASP OMBUDSMAN . . . . . . . . . . . . . . . . . . . . . iv
DEFINITION OF SHAREWARE . . . . . . . . . . . . . . . . v
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . 1
TERMINOLOGY AND CONVENTIONS . . . . . . . . . . . . . . 3
DOS ERRORLEVEL and Batch Files . . . . . . . . . . . . . 5
INTERACTIVE UTILITIES . . . . . . . . . . . . . . . . . . . . 7
SELECT.COM . . . . . . . . . . . . . . . . . . . . . . . 7
CONFIRM.COM . . . . . . . . . . . . . . . . . . . . . . 10
WAIT.COM . . . . . . . . . . . . . . . . . . . . . . . . 11
GETKEY.COM . . . . . . . . . . . . . . . . . . . . . . . 12
SLEEP.COM . . . . . . . . . . . . . . . . . . . . . . . 13
BLEEP.COM . . . . . . . . . . . . . . . . . . . . . . . 14
VIDEO UTILITIES . . . . . . . . . . . . . . . . . . . . . . . 17
VPSET.COM . . . . . . . . . . . . . . . . . . . . . . . 17
VPCOPY.COM . . . . . . . . . . . . . . . . . . . . . . . 18
VPFLIP.COM . . . . . . . . . . . . . . . . . . . . . . . 19
VPCLS.COM . . . . . . . . . . . . . . . . . . . . . . . 20
Table 1: Screen Colors . . . . . . . . . . . . . . 21
VPSTRIPE.COM . . . . . . . . . . . . . . . . . . . . . . 22
VPTNT.COM . . . . . . . . . . . . . . . . . . . . . . . 22
VPBH.COM . . . . . . . . . . . . . . . . . . . . . . . . 23
VPAT.COM . . . . . . . . . . . . . . . . . . . . . . . . 24
VPBOX.COM . . . . . . . . . . . . . . . . . . . . . . . 25
Table 2: Border Styles . . . . . . . . . . . . . . 27
SECURITY AND DIAGNOSTIC UTILITIES . . . . . . . . . . . . . . 28
HANG.COM . . . . . . . . . . . . . . . . . . . . . . . . 28
REBOOT.COM . . . . . . . . . . . . . . . . . . . . . . . 29
WHATIS.COM . . . . . . . . . . . . . . . . . . . . . . . 31
i
SHAREWARE REGISTRATION FORM
Fill out this form and mail with your cheque, money order or VISA card
number to:
Herne Data Systems Ltd., PO Box 250, Tiverton, ON, CANADA N0G 2T0
Please register my copy of Utility_Belt Collection for $25 (US), [ ]
$29 (CDN), plus $2 p & h.
Please register my copy of _______________ from the Utility_Belt [ ]
collection for $10 (US) or $12 (CDN), plus $2 p & h
Disk size required 720 k - 3.5" [ ] 360 k - 5.25" [ ]
Please send me the Herne Data Systems Shareware Evaluation Pak for [ ]
$5 plus $2 p & h (Evaluation copies of all Herne Data Systems
shareware products including MAXI-Form, Utility_Belt, Over_LAZ
and NPS Nominal Pipe Size) (3.5" disk only)
Please send me more information on LAN and Site Licenses [ ]
Cheque or money order enclosed [ ] or charge my VISA card* [ ]
VISA # _____/_____/_____/_____ Expiry __/__ Total Amount* __________
Phone # (_____) _____-________ Signature _____________________________
NOTE: * All VISA orders will be charged in CANADIAN DOLLARS.
VISA orders can be FAXed to (519) 366-2732 for faster service.
Name __________________________________________________________
Address __________________________________________________________
City ____________________________ Prov/State_____________
Zip ____________________________ Country _____________
Canadian orders include GST. PST must be added to total charge for ONTARIO
residents.
Please add $4.00 postage and handling for shipments outside CANADA and the
USA. Payment for international orders can be made by VISA card,
international money order (in US$ or CDN$), or Eurochecks in the currency
of the issuing country (e.g. Sterling, Francs and most other other major
currencies).
All orders are shipped by first class air mail. Please allow two weeks for
delivery. Sorry, we cannot accept COD orders.
ii
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
THE FINE PRINT
DISCLAIMER - AGREEMENT
Users of the Utility_Belt shareware collection must accept this
disclaimer of warranty:
"The software programs comprising the Utility_Belt
collection are supplied as is. The author disclaims all
warranties, expressed or implied, including, without
limitation, the warranties of merchantability and of fitness
for any purpose. The author assumes no liability for
damages, direct or consequential, which may result from the
use of any of the Utility_Belt software programs. Herne
Data Systems reserves the right to make changes, additions
and deletions to the Utility_Belt Collection at any time
without prior notice."
This evaluation version of the Utility_Belt collection is a
"shareware program" and is provided at no charge to the user for
evaluation. Feel free to share it with your friends, but please
do not give it away altered or as part of another system. The
essence of "user-supported" software is to provide personal
computer users with quality software without high prices, and yet
to provide incentive for programmers to continue to develop new
products. If you find any of the programs useful and find that
you continue to use any of the Utility_Belt programs after a 30
day trial period, you must make a registration payment of $10
(US), $12 (CDN) (plus $2 postage and handling) for any single
program in the Utility_Belt collection, or $25 (US), $29 (CDN)
(plus $2 postage and handling) for the entire collection to Herne
Data Systems Ltd. Cheque, money order, VISA credit card and
corporate/institutional purchase orders are accepted. The single
user registration fee will license one copy for use on any one
computer at any one time. You must treat this software just like
a book. An example is that this software may be used by any
number of people and may be freely moved from one computer
location to another, so long as there is no possibility of it
being used at one location while it's being used at another. Just
as a book cannot be read by two different persons at the same
time.
Commercial, corporate and institutional users of Utility_Belt
must register and pay for their copies of Utility_Belt within 30
days of first use or their license is withdrawn. Site Licenses
are available for $50 (US) or $55 (CDN) for any individual
program, or $125 (US) or $135 (CDN) for the entire collection
directly from Herne Data Systems Ltd.
Any individual, corporation or institution distributing
iii
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
Utility_Belt for any kind of remuneration must first contact
Herne Data Systems Ltd. at the address below for authorization.
This authorization will be granted automatically to distributors
recognized by the ASP as adhering to its guidelines for shareware
distributors, and such distributors may begin offering
Utility_Belt immediately (However Herne Data Systems Ltd. must
still be advised so that the distributor can be kept up-to-date
with the latest version of Utility_Belt.).
You are encouraged to pass a copy of Utility_Belt along to your
friends for evaluation. Please encourage them to register their
copy if they find that they can use it.
REGISTRATION BENEFITS
All registered users will receive a copy of the latest version of
the Utility_Belt system, along with free technical support and
upgrades for 60 days.
Registered users can also upgrade to later versions (beyond the
initial 60 day free support period) for a nominal update fee of
$5 plus $2 postage and handling. (US or CDN funds).
REGISTRATION AND CUSTOMER SUPPORT ADDRESS
Please address all registration requests and customer support
inquiries to:
Herne Data Systems Ltd.,
PO Box 250, Tiverton, ON N0G 2T0 CANADA
voice or FAX (519)366-2732
You may also leave comments (we welcome all feedback - either
positive or negative) addressed to CompuServe ID 72060,1153.
ASP OMBUDSMAN
This program is produced by a member of the Association of
Shareware Professionals (ASP). ASP wants to make sure that the
shareware principle works for you. If you are unable to resolve
a shareware-related problem with an ASP member by contacting the
member directly, ASP may be able to help. The ASP Ombudsman can
help you resolve a dispute or problem with an ASP member, but
does not provide technical support for members' products. Please
write to the ASP Ombudsman at: 545 Grover Road, Muskegon, MI
49442 USA or send a Compuserve message via easyplex to ASP
Ombudsman 70007,3536
iv
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
DEFINITION OF SHAREWARE
Shareware distribution gives users a chance to try software
before buying it. If you try a Shareware program and continue
using it after a reasonable evaluation period, you are expected
to register. Individual programs differ on details -- some
request registration while others require it, some specify a
maximum trial period. With registration, you get anything from
the simple right to continue using the software to an updated
program with printed manual.
Copyright laws apply to both Shareware and commercial software,
and the copyright holder retains all rights, with a few specific
exceptions as stated below. Shareware authors are accomplished
programmers, just like commercial authors, and the programs are
of comparable quality. (In both cases, there are good programs
and bad ones!) The main difference is in the method of
distribution. The author specifically grants the right to copy
and distribute the software, either to all and sundry or to a
specific group. For example, some authors require written
permission before a commercial disk vendor may copy their
Shareware.
Shareware is a distribution method, not a type of software. You
should find software that suits your needs and pocketbook,
whether it's commercial or Shareware. The Shareware system makes
fitting your needs easier, because you can try before you buy.
And because the overhead is low, prices are low also. Shareware
has the ultimate money-back guarantee -- if you don't use the
product, you don't pay for it.
v
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
INTRODUCTION
Add some pizzazz to your batch files! Utility_Belt is a
collection of batch file, security and diagnostic utilities
designed to give an advanced, professional look to even the
simplest of batch files. Each program was designed for a
specific purpose. To see a demonstration of the programs in
action, run the batch file BELTDEMO.BAT. The various programs
outlined below are used extensively in this demonstration. Feel
free to copy and modify parts of the demo batch file for your own
batch files.
* * * *
THIS DOCUMENTATION ASSUMES THAT THE READER IS
REASONABLY FAMILIAR WITH MS-DOS AND BATCH FILE
CONCEPTS. HOWEVER, BY FOLLOWING THE EXAMPLES GIVEN IN
THE TEXT, EVEN A RELATIVELY IN-EXPERIENCED USER CAN
CREATE PROFESSIONAL LOOKING BATCH FILES WITH EASE!
* * * *
The following programs are included in the Utility_Belt
collection:
Interactive Utilities:
SELECT Allows a user to choose from a list of options and can
be used to direct the flow of the batch file
accordingly. SELECT is typically used for a menu type
system.
CONFIRM Prompts the user for a Yes/No response and can be used
to direct the flow of the batch file accordingly.
CONFIRM is typically used prior to executing any action
which may be destructive, such as erasing a file.
WAIT Prompts the user to procede or quit and can be used to
direct the flow of the batch file accordingly. WAIT is
typically used to prompt a user to do something (like
swap disks) before proceding.
GETKEY Waits for a key press from the keyboard and returns a
value based on the ASCII code of the key pressed.
GETKEY is typically used for custom menu type programs.
SLEEP Pauses the computer for the specified length of time.
SLEEP is typically used to pause momentarily while a
message is displayed on the screen.
1
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
BLEEP Sounds a user defined tone (or series of tones) on the
speaker. BLEEP is typically used prior to any special
alert or warning messages which are displayed by the
batch file.
Video Utilities:
VPSET Set the current video display page for text modes.
VPSET is typically used to build a screen with the
other video utilities (e.g. VPCOPY, VPCLS, VPBOX, etc.)
then switch to it instantly.
VPCOPY Copy one video text page to another. This allows a
text page to be saved then recalled later.
VPFLIP Let the user flip instantly between alternate display
pages that have been created with the other video
programs.
VPCLS Clear the screen of the specified video page to a
specified color.
VPTNT Clear the current screen to the specified colors in an
explosive effect.
VPBH Clear the current screen to the specified colors in a
'black hole' effect.
VPSTRIPE Similar to VPCLS, but will produce a striped or rainbow
pattern on the screen. Stripes can be horizontal or
vertical.
VPAT Print a text string at a specified location on the
screen.
VPBOX Draws a box of a given size at a given location on the
screen. Typically used with VPAT to create message
windows on a screen.
Security and Diagnostic Utilities:
HANG Will lock up a computer and require a power-off/power-
on reset sequence. HANG is typically used to lock up a
computer if, for example, a user fails on several
attempts to log into a network.
REBOOT Software controlled rebooting of the computer. REBOOT
is typically used after changing or creating a
2
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
customized CONFIG.SYS file. It can also be used to
automatically reset a computer if a user fails to log
into a network correctly.
WHATIS A diagnostic program which reports the BIOS and DOS
physical and logical parameters associated with disk
drives.
All of the programs in the Utility_Belt collection were written
in assembler to ensure compact, fast code. (The average size of
the programs is less than 2k bytes long!) Each of the programs
is self documenting to a certain extent. If you run the programs
without any command line options, you will get a summary of the
syntax and available options.
In addition to the main programs, the Utility_Belt collection
disk will contain other related files:
ASP.COM Displays the Association of Shareware
Professionals ombudsman message.
BELTDEMO.BAT A demonstration batch file which incorporates the
various programs of the Utility_Belt collection.
Run this file for a good overview.
BELT.DOC This documentation file.
BELT1xx.ZIP A ZIP file which contains all of the other files
on the disk. You can upload this file to all of
your favorite BBS's, or pass it around to your
friends.
UPDATE.DOC A summary of new features added since the last
release. This file may not be present, depending
on the version.
CATALOG.DOC This file contains a listing of other exciting
Herne Data Systems Ltd. shareware and commercial
software products.
TERMINOLOGY AND CONVENTIONS
All of the programs in the Utility_Belt collection are 'command
line driven' (i.e. they rely on options specified on the command
line to determine what they should do). In this documentation,
curly braces { } are used to denote the names of parameters that
must be supplied for each program, e.g. {list_name}. Parameters
which are also enclosed in square brackets [ ] are optional (e.g.
[{item_10}]). If optional parameters are not specified, default
3
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
values are assumed.
Numeric values are entered in normal ASCII decimal fashion (i.e.
10 is the number ten). Text string entries can be any
combination of normally printable characters. Case sense
(uppercase and lowercase) are preserved for text strings.
Embedded spaces (i.e. the space left between words) are generally
allowed, but leading spaces (i.e. any blanks at the beginning of
the text) are automatically removed. ("This ==> <== is an
embedded space". " <== This is a leading space.") Any of the
numeric values or strings can include or be substituted by the
DOS batch file variables (%1, %2, etc.) to provide more
flexibility.
The required parameters and default values for any optional
parameters are listed below in the description for each program.
Examples of usage for each program are also given. In all cases,
neither the curly braces, nor the square brackets are actually
typed on the command line.
With the exception of SELECT, all programs requiring multiple
parameters must have these parameters separated on the command
line by at least one space character. In order to allow embedded
spaces in the parameter strings, SELECT uses a semi-colon ; as a
parameter separator character.
For programs which take a can take a long list of optional
parameters (such as SELECT and VPFLIP), three dots ... indicates
that you can continue on with similar parameters, up to the
maximum number specified by the program.
Angle brackets < > (a.k.a. less than and greater than signs) are
used to denote special keys on the keyboard. For example, <Esc>
refers to the single key marked ESC or ESCAPE; while <Enter>
refers to the ENTER or RETURN key.
4
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
DOS ERRORLEVEL and Batch Files
This documentation is not intended to be a comprehensive course.
I know this is obvious, but it is worth saying anyway: One of the
most often overlooked sources of information is the manuals and
user guides which come with MS-DOS! If you want a different
perspective on batch files, there are many excellent books and
magazine articles about MS-DOS batch file programming at all
levels from introductory to advanced.
However, before describing each program, a brief description of
how DOS responds to the interactive utilities is in order.
The user response utilities in the collection (SELECT, WAIT and
CONFIRM, and GETKEY) rely on the DOS ERRORLEVEL variable to
direct batch file flow. In order for the batch files to function
correctly, a basic understanding of ERRORLEVEL is required.
When any program terminates and returns control to DOS (or the
batch file which initiated it), it can set a DOS variable called
ERRORLEVEL. Normally, this would have a value of 0 which
indicates that the program successfully completed its task.
Other values can be set and may indicate either an error in the
program, or some other data that the program wishes to pass on to
subsequent programs in a batch file. This value can be detected
and used to control the flow in batch files. The general
procedure in a batch file is:
program_or_command_name
IF ERRORLEVEL x GOTO {label}
where program_or_command_name is the name of a DOS command, .EXE,
.BAT or .COM program file (e.g. FORMAT), x is the value (from 0
to 255) and [label] is a statement in the batch file to go to.
For example:
IF ERRORLEVEL 5 GOTO ITEM5
IF ERRORLEVEL 4 GOTO ITEM4
IF ERRORLEVEL 3 GOTO ITEM3
IF ERRORLEVEL 2 GOTO ITEM2
IF ERRORLEVEL 1 GOTO ITEM1
:ITEM5
(some commands here)
:ITEM4
(some more commands here)
:ITEM3
(etc)
:ITEM2
(etc)
:ITEM1
(etc)
5
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
Notice that the IF ERRORLEVEL x statements are arranged from
highest value to lowest value. This is required due to a quirk
in DOS. The IF ERRORLEVEL command actually does a 'greater than
or equal' type of comparison. If ERRORLEVEL was 5 and the first
statement was IF ERRORLEVEL 1, then since 5 is greater than or
equal to 1, the statement would be executed, which is not what we
would normally want. All this may seem a bit confusing at first,
but if you remember that all IF ERRORLEVEL statements must be
arranged in descending order (i.e. from high to low as shown in
the example above), then you can't go wrong.
6
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
INTERACTIVE UTILITIES
One of the most frequent complaints about DOS batch file
programming is the inability to get meaningful input from the
user. Sure, DOS batch files have the 'PAUSE' command, but all
that does is ask you to press a key. The batch file programmer
has no easy way to tell which key was pressed.
The five interactive utilities (SELECT, WAIT, CONFIRM, GETKEY and
SLEEP) in the Utility_Belt allow the programmer to check which
key was pressed and direct the flow of batch file accordingly.
Each utility that reads a key press will clear the keyboard
buffer before getting the key. This prevents extraneous key
presses from disrupting the batch file (e.g. if an over-anxious
user presses a key before they should).
SELECT.COM
SELECT allows a user to choose an option from a list of items and
direct the flow of the batch file accordingly. It can be used
for anything from simple user queries to a sophisticated menuing
system. SELECT will set the DOS ERRORLEVEL value corresponding
to the selected choice. Two syntaxes are supported. The first
is:
SELECT {list_name};{item_1};[{item_2}; ... ;{item_10}]
where: {list_name} A title that is printed in the menu
title block. The title can be up to 20
characters long. Longer titles will be
truncated to 20 characters.
{item_1} (etc) The items in the menu list. Up to 10
items can be listed, each up to 15
characters long. Longer items will be
truncated to 15 characters.
The total length of the text string must be less than 120
characters. Each item in the list must be separated by a semi-
colon (;). All printable characters (except ; which is used as
the separator, or /N at the beginning of {list_name} which is
used as a switch to denote the second form of the command),
including embedded spaces, are allowed. Uppercase and lowercase
letters are preserved. SELECT will print a header message which
includes the {list_name}, followed by the item list and a footer
message which prompts the user to press the key 'A' to x, where x
depends on the number of items in the list. SELECT will accept
either uppercase or lowercase key press responses. If the <Esc>
7
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
key is pressed, SELECT will return an error code corresponding to
'no selection made'. If any other key is pressed, SELECT will
beep and wait for the next key press.
For example:
SELECT Main Menu;WordProcessor;SpreadSheet;Graphics;Utilties
will display the following menu on the screen:
Main Menu
A: WordProcessor
B: SpreadSheet
C: Graphics
D: Utilities
PRESS: 'A' to 'D' letter key to select an item; or
<Esc> to QUIT without selecting any.
When one of the available choices is made, SELECT will return the
following ERRORLEVEL values:
--------------+-----------------
Key Pressed ERRORLEVEL value
--------------+-----------------
<Esc> 0
A 1
B 2
C 3
D 4
etc
J 10
--------------+-----------------
The second syntax supported by SELECT is:
SELECT /N{nn}
where {nn} is the number of choices, from 1 to 10. With this
form, no header, menu list or footer messages are displayed.
SELECT will just wait for a key to be pressed (within the range
of 'A' to x, or <Esc>, as above), then return the corresponding
ERRORLEVEL value. For example:
SELECT /N5
will wait for a key press in the range of A to E, or <Esc> and
then return an ERRORLEVEL value of 1 to 5 or 0.
8
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
Continuing with the first example listed above, a sample batch
file (MENU1.BAT) using SELECT might consist of:
REM === MENU1.BAT
@ECHO OFF
:MAIN
REM === clear screen and display menu options
CLS
SELECT Main Menu;WordProcessor;SpreadSheet;Graphics;Utilties
REM === interpret ERRORLEVEL codes and branch to selection
IF ERRORLEVEL 4 GOTO UTIL
IF ERRORLEVEL 3 GOTO GRAPH
IF ERRORLEVEL 2 GOTO SPREAD
IF ERRORLEVEL 1 GOTO WORDPRO
REM === ERRORLEVEL = 0 if <Esc> key pressed
ECHO NO SELECTION MADE
GOTO END
REM === execute main menu selections
:UTIL
REM === present a sub-menu
CLS
SELECT Utility Menu;Norton;MAXI Disk
IF ERRORLEVEL 2 GOTO NOR
IF ERRORLEVEL 1 GOTO MAX
REM === return to main menu if <Esc> pressed on sub-menu
GOTO MAIN
:NOR
CD\UTILITY
NU
GOTO MAIN
:MAX
CD\MAXIDISK
MAX3
GOTO MAIN
:GRAPH
CD\GRAPH
HG
GOTO MAIN
:SPREAD
CD\SPREAD
123
GOTO MAIN
:WORDPRO
9
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
CD\WORDPRO
WP
GOTO MAIN
:END
As shown with item 4 in the main menu list (:UTIL), several
levels of SELECT can be 'nested' or used in a batch file menu
system to create multiple menu levels. In the above example, as
each program ends, the user will be returned to the start of the
main menu. Also, if the <Esc> key is pressed on the main menu,
the user will exit to DOS. If the <Esc> key is pressed while in
the Utilities sub-menu, the user will be returned to the top of
the main menu.
If no parameters are specified on the command line, SELECT will
display a summary of the program options.
CONFIRM.COM
CONFIRM will display a prompt and accept a Y (for yes) or N (for
no) key input. All other key presses will produce an error beep
and will be ignored. CONFIRM is used to present a YES/NO
question and will return an ERRORLEVEL of 0 for a yes response,
or 1 for a no response. It is typically used prior to executing
any action which may be destructive, such as erasing a file. The
syntax is:
CONFIRM {text_string}
{text_string} can be up to 120 characters long, and can contain
any printable character. Uppercase and lowercase characters are
preserved. CONFIRM will display a header message, the
{text_string} followed by a question mark (?), then a footer
message prompting the user to press either the Y or N key.
For example, the command line:
CONFIRM Delete all the files
will produce the display:
Do you wish to:
Delete all the files?
Press 'Y' for YES or 'N' for NO
10
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
Typical usage in a batch file (WIPEDISK.BAT) might be:
REM === WIPEDISK.BAT
@ECHO OFF
REM === ask user to confirm action before doing it
CONFIRM Delete all the files on %1
IF ERRORLEVEL 1 GOTO END
DELETE %1*.*
:END
In this example with the command line WIPEDISK A:, if the user
pressed the N key for no, the batch file would branch to the :END
statement and nothing would happen. If the Y for yes key was
pressed, the DOS command DELETE A:*.* would be performed to erase
everything on drive A:.
If no parameters are specified on the command line, CONFIRM will
display a summary of its syntax.
WAIT.COM
WAIT will display a prompt and accept a key press. If the <Esc>
is pressed, an ERRORLEVEL of 1 will be returned. All other key
presses will produce an ERRORLEVEL of 0. WAIT is used to pause a
batch file until a specific action is performed by the user, then
branch to one of two outcomes. It is typically used prior to
executing any action which may require user intervention, such as
inserting a disk. The syntax is:
WAIT {text_string}
{text_string} can be up to 120 characters long, and can contain
any printable character. Uppercase and lowercase characters are
preserved. WAIT will display a header message, the
{text_string}, then a footer message prompting the user to press
either the <Esc> key to quit or any other key to continue.
For example, the command line:
WAIT Insert disk in drive A:
will produce the display:
Please:
Insert disk in drive A:
Then press: <Esc> to ABORT or
11
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
any other key to CONTINUE
Typical usage in a batch file (ALLCOPY.BAT) might be:
REM === ALLCOPY.BAT
@ECHO OFF
WAIT Insert disk with files to copy in drive %1
IF ERRORLEVEL 1 GOTO END
COPY %1*.* %2
:END
To copy all the files from drive A: to drive C:, you would use
the command: ALLCOPY A: C:. In this example, if the user
pressed the <Esc> key to ABORT, the batch file would branch to
the :END statement and nothing would happen. If any other key
was pressed, the DOS command COPY A:*.* C: would be performed to
copy the file from the drive A: to drive C:.
If no parameters are specified on the command line, WAIT will
display a summary of its syntax.
GETKEY.COM
GETKEY waits for a key press from the keyboard and returns an
ERRORLEVEL equal to the ASCII code of the key pressed. GETKEY
does not display any prompt. The syntax is:
GETKEY {key_mode}
where {key_mode} can be any of:
A will accept all regular keys (numbers, symbols, letters,
<Enter>, <Esc>) that have an ASCII code associated with
them. GETKEY will return an ERRORLEVEL value of 1 to 255
corresponding to the ASCII code of the key pressed. The
'special' keys, such as the function keys, <PgUp>, <Home>,
<End>, etc., will all return an ERRORLEVEL value of 0.
# will accept numeric keys only (numbers 0 to 9), either from
the main keyboard or from the numeric keypad. GETKEY will
return an ERRORLEVEL value of 48 to 57, corresponding to the
ASCII code for numerals 0 to 9.
N as with the # option, but will return an ERRORLEVEL value of
0 to 9, corresponding to the numeric value of the key
pressed.
12
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
The ERRORLEVEL returned by GETKEY can be used by the batchfile to
branch to an appropriate routine, or it can be ignored if just
any key press is required to continue, like the DOS PAUSE
command. Unlike the DOS PAUSE command, however, GETKEY will not
display a prompt.
Typical usage in a batch file called DIRBC.BAT might be:
REM === DIRBC.BAT
@ECHO OFF
REM === display directory of all batch files
DIR %1*.BAT/w
REM === wait until user presses a key to display .COM files
ECHO Press any key to display .COM files
GETKEY A
REM === display directory of all .COM files
DIR %1*.COM/W
This example ignores the ERRORLEVEL return code. To view all the
.BAT and .COM files on drive A: with this example, you would use:
DIRBC A:
If no parameters are specified on the command line, GETKEY will
display a summary of its syntax.
SLEEP.COM
SLEEP is used to pause the execution of a batch file for a given
length of time. Optionally, a message may be displayed on the
screen and/or a key press can be used to cancel the 'sleep'
period. Four separate forms of the command are available:
SLEEP /N{nn}
SLEEP /C{nn}
SLEEP /T{nn};{message}
SLEEP /K{nn};{message}
In each case, {nn} is the sleep period in seconds (approximate).
{nn} must be an integer in the range of 1 to 65535. With the
/N{nn} option, SLEEP will wait for the specified length of time,
then return control to the batch file. The /C{nn} option is
similar, but any key press will cancel the sleep and return to
the batch file immediately. The /T and /K options will display a
message on the screen during the sleep period. /T will wait the
specified time, while /K can be cancelled with a key press.
{message} can be up to 120 characters long, and can contain any
13
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
printable character. Uppercase and lowercase characters are
preserved. The /T{nn} (or /K{nn}) and {message} must be
separated by a semi-colon (;).
For example:
SLEEP /N10
will pause the computer for about 10 seconds, then resume.
SLEEP /C60
will pause the computer for 60 seconds. If at any time during
this period, the user presses a key, the sleep period is
immediately cancelled.
SLEEP /T30;Waiting for 30 seconds . . .
will display a header message, then "Waiting for 30 seconds . .
." and pause the computer for 30 seconds.
SLEEP /K30;Waiting for 30 seconds . . .
is similar to the previous example, except a key press can be
used to cancel the sleep period.
A typical usage in a batch file might be to display a greeting
message on the screen just long enough to inform the user, then
continue on with the batch file GOODMORN.BAT:
REM === GOODMORN.BAT
@ECHO OFF
VPSTRIPE 0 V
VPBOX 0 1 9 1 8 20 16 60
VPAT 0 1 14 12 30 Good Morning !!
SLEEP /C10
(Note: the VPSTRIPE, VPBOX and VPAT commands are explained below
in the video utilities section.)
If no parameters are specified on the command line, SLEEP will
display a summary of its syntax and options.
BLEEP.COM
Sounds a user defined tone (or series of tones) on the speaker.
BLEEP is typically used prior to any special alert or warning
messages which are displayed by the batch file. The syntax is:
14
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
BLEEP {repeats} {freq} {length} {pause} [;{repeats} {freq}
{length} {pause}; ....]
where:
{repeats} is the number of times the note is to be repeated;
{freq} is the frequency of the note in Hertz (cycles per
second). If no frequency is specified, a value of 1200
is assumed;
{length} is the duration of the note in 'system timer ticks'.
There are approximately 18 timer ticks per second. If
no length is specified, a value of 2 is assumed;
{pause} is the duration of the rest period between notes, in
system timer ticks. If no pause is specified, a value
of 2 is assumed.
For example,
BLEEP 2 1000 3 2
will sound a 1000 Hz note for 3 timer ticks (~ 1/6 second) then
wait for 2 timer ticks.
Default values are provided for most of the parameters. If the
defaults are used, the only required parameter is the {count}
value. If all of the parameters are not specified, the command
line must be terminated with a semi-colon (;). For example:
BLEEP 2;
will sound a sequence of two default (1200 Hz) notes, each for a
default time of 2 timer ticks followed by a default pause of 2
timer ticks.
BLEEP 2 800 3;
will sound a sequence of 2 800 Hz notes for three ticks followed
by a two tick pause.
More than one tone can be sounded in a given sequence. In this
case each group of parameters must be separated by a semi-colon
(;). For example:
BLEEP 1 400 2 1;2 600 3 2;1 800;2;
will sound the following sequence of 6 notes:
- one note at 400 Hz for 2 ticks with a 1 tick pause;
15
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
- 2 notes at 600 Hz for 3 ticks each with a 2 tick pause;
- 1 note at 800 Hz for 3 ticks with a 2 tick pause;
- 2 notes at 800 Hz for 3 ticks each with a 2 tick pause.
Note that for a multiple tone sequence, if parameters are not
specified, those used for the previous tone are assumed as the
new default values.
If no parameters are specified on the command line, BLEEP will
display a summary of its syntax and options.
16
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
VIDEO UTILITIES
All video display adaptors, except for the original IBM
Monochrome Display Adaptor (MDA) have the capability to access
more than one video 'page'. The Color Graphics Adaptor (CGA) has
4 video pages in 80 column text mode, while the Enhanced Graphics
Adaptor (EGA) and the Video Graphics Array (VGA) displays each
have 8 video text pages. Having more than one video page lets a
user switch display screens instantly. This can be used as an
easy method to save output screens, create overlapping screen
windows, etc. Each page can have its own text, colors, cursor
location, etc. and can be written to or erased without affecting
the other pages. Only one display page is visible at a time, but
any page can be made visible, not just the default page (0).
Why don't many software programs take advantage of the multiple
text pages that are available? Probably the main reason is
compatibility with older equipment. In order to sell the most
software, you design it to work on the 'lowest common
denominator'. In the case of video displays, this is the good
old MDA, with its single display page.
The video utilities in the Utility_Belt package provide a
comprehensive set of tools to access all of the text mode video
pages available on CGA, EGA and VGA displays. With the exception
of the instruction prompt printed by VPFLIP, none of the video
utilities will display a header message of any kind when they are
used. This ensures that such messages do not encroach upon your
video displays.
VPSET.COM
VPSET is used to set the current video display page for text
modes. VPSET is typically used to instantly switch to a a screen
which was built in the background with the other video utilities
(such as VPCOPY, VPBOX, VPAT, etc). The syntax is:
VPSET {video_page} [{cursor_line}]
where:
{video_page} is the number of the video page to switch to; and
{cursor_line} is the screen line on the new page to place the
cursor.
{video_page} can have a value of 0 to 3 for the CGA display and 0
17
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
to 7 for the EGA or VGA. {cursor_line} normally has a value of 0
to 24, with 0 being the top of the screen and 24 being the
bottom. On some EGA and VGA modes, {cursor_line} can be up to 49
or more. If {cursor_line} is omitted, line 0 (i.e. the top of
the page) is assumed.
For example:
VPSET 2 15
will set the currently displayed video page to 2 and set the
cursor on line 15.
VPSET can be used to switch to a screen which has been built
using other video commands. When the VPSET command is issued, it
will look as though the new screen appears instantly.
VPSET can also be used with normal DOS commands to change the
screen where program output is displayed. For example, the batch
file SAVEDIR.BAT will keep a copy of the disk directory on video
page 3:
REM === SAVEDIR.BAT
@ECHO OFF
VPSET 3
DIR %1*.*/W
VPSET 0
By using the command SAVEDIR A:, you can keep a copy of the
directory of A: drive for future reference. To see the directory
again, use the command:
VPSET 3 22
The directory will be instantly displayed and you do not even
have to have the disk still in your drive! To switch back to the
normal screen, use the command:
VPSET 0
(In the above example, you could also use the command VPFLIP (see
below) to flip through several video pages and display their
contents in sequence.)
If no parameters are specified on the command line, VPSET will
display a summary of its syntax and options.
VPCOPY.COM
VPCOPY will copy the contents of one video text page to another,
18
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
complete with all screen attributes (colors). This allows a text
page to be saved then recalled later. It also allows multiple
copies of a page to be created, each of which can then be
modified without affecting the others (e.g. for creating a series
of seemingly overlapping pop-up windows). The syntax is:
VPCOPY {from_page} {to_page}
where:
{from_page} is the video page being copied from; and
{to_page} is the page being copied to.
Note that any existing contents of the {to_page} will be
destroyed. Both {from_page} and {to_page} have a range of 0 to 3
for the CGA display and 0 to 7 for the EGA and VGA displays.
For example:
VPCOPY 0 2
will copy the contents of video page 0 to page 2. Try the
following short command sequence, either in a batch file or by
typing it in directly on the command line:
CLS
DIR/W
VPSET 2
CLS
VPCOPY 0 2
What you will see after the VPCOPY step is the directory that was
originally displayed on the other page suddenly appearing.
(Don't forget to go back to the default page with a VPSET 0 when
you are done.)
If no parameters are specified on the command line, VPCOPY will
display a summary of its syntax and options.
VPFLIP.COM
VPFLIP will let the user flip instantly between alternate display
pages that have been created with the other video commands. Up
to eight video pages can be displayed in any sequence. When
exiting VPFLIP, you are returned to the original video page (i.e.
19
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
the display page which was showing when the VPFLIP command was
issued), which need not be in the sequence that was flipped
through. The syntax is:
VPFLIP {first_page} [{second_page} {third_page} ...
{eighth_page}]
where {first_page}, {second_page}, etc. are the video pages to be
flipped through. These pages can be in any order, and will be
displayed in the sequence that they are entered on the command
line. For example, the command line:
VPFLIP 1 4 7 2 6
will display page 1, followed by 4, then 7, 2, 6 and back to 1
again. The <PgDn> key is used to go to the next page in the
sequence and <PgUp> is used to go to the previous page. <Esc> is
used to quit VPFLIP and return to the original video page. A
prompt message is displayed in black on white text on line 24 of
each page.
Note: when using VPFLIP, line 24 of the pages being flipped
through is erased by the prompt message. Line 24 of the original
page, if it was erased as part of the flip sequence, is restored
when exiting VPFLIP.
VPFLIP is typically used to create a mini 'slide show' to display
a number of screens, or to view output screens that were
redirected with the VPSET command.
If no parameters are specified on the command line, VPCOPY will
display a summary of its syntax and options.
VPCLS.COM
The DOS CLS (CLear Screen) command is designed to clear the
screen (i.e. erase the contents of the screen and put the cursor
on the top line) of the currently active video page to the
default colors (usually white on black, unless this has been
changed by a special utility or driver such as ANSI.SYS). It has
no effect on any page other than the currently active page.
VPCLS will clear any specified video page, to any specified
combination of colors that is supported by your display adpator.
The syntax is:
VPCLS {video_page} [{background_color} {foreground_color}]
where:
{video_page} is the display page to be cleared (0 only for the
20
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
MDA, 0 to 3 for the CGA, 0 to 7 for the EGA or
VGA); and
{background_color} and {foreground_color} are the screen
colors to set.
The colors are optional. For the MDA, they must be either 0
(black) or 7 (white). (Even with the MDA, it is still possible
to get black on white rather than the normal white on black.)
For the CGA, EGA and VGA adaptors, color values of 0 to 7 are
available for {background_color} and 0 to 15 for
{foreground_color}. If they are not specified, white text on a
black background is assumed. If only the {background_color} is
specified, white is assumed for the {foreground_color}. The
acceptable color values are listed in the following table:
Table 1: Screen Colors
--------------------+--------------------
Color Value Color
--------------------+--------------------
0 Black
1 Blue
2 Green
3 Cyan
4 Red
5 Magenta
6 Brown
7 White Note: the 'bright' colors
8 Gray (Bright Black) (8 to 15) can be
9 Bright Blue used for foreground
10 Bright Green choices only.
11 Bright Cyan
12 Bright Red
13 Bright Magenta
14 Yellow (Bright Brown)
15 Bright White
--------------------+--------------------
(Note: This color table is used by all of the video commands
which require colors to be specified.)
For example:
VPCLS 1
will clear video page 1 to white on black.
VPCLS 3 5 14
will clear video page 3 to yellow on magenta.
VPCLS 2 3
21
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
will clear video page 2 to white on cyan.
If no parameters are specified on the command line, VPCLS will
display a summary of its syntax and options.
VPSTRIPE.COM
Similar to the DOS CLS command, VPCLS will clear a screen to a
single pair of background and foreground colors. For visual
effect, VPSTRIPE will produce a striped or rainbow pattern on the
screen. Stripes can be horizontal or vertical in any combination
of colors. The striped screen can then be used as a background
for text windows produced with the VPBOX and VPAT commands. The
syntax is:
VPSTRIPE {video_page} {stripe_mode} [{color_1} {color_2}]
where:
{video_page} is the display page to be cleared with stripes (0
only for the MDA, 0 to 3 for the CGA, 0 to 7 for
the EGA or VGA);
{stripe_mode} is H for horizontal stripes or V for vertical
stripes.
{color_1} and {color_2} are the screen colors to set for a two
color stripe pattern. Color values of 0 to 15 can be specified
for each color. The color values are listed above under the
VPCLS command and are optional. If they are not specified, a 16
color rainbow pattern is used with colors shown in the order of
the above color table.
VPSTRIPE creates stripes by printing a line of 'block' characters
(ASCII code 219) in the specified color, using black as the
'background' color. Using this method allows 16 color stripes to
be displayed, not just the 8 normal background colors. When text
is subsequently printed directly on the striped background, the
text will be shown as the stripe color on a black background.
However, in the case of rainbow screens, text will not show up on
the black stripes (i.e. they will be printed black on black).
If no parameters are specified on the command line, VPSTRIPE will
display a summary of its syntax and options.
VPTNT.COM
The standard method to clear the video display (i.e. CLS or
VPCLS) produces a rather boring video effect for anyone who may
22
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
be watching it. Sometimes, you may want to have the screen
clearing process as part of the overall visual impact of the
batch file. Utility_Belt offers two programs to produce a
visually more interesting screen clearing effect: VPTNT and
VPBH. Since each of these programs is designed for a visual
effect, they work only with the currently active screen page.
However, they work with any active screen page set by the VPSET
command, not just the default page 0.
VPTNT will clear the current screen to the specified colors in an
explosive effect (i.e. any existing text on the screen appears to
be flung out from the center of the screen to the edges). The
syntax is:
VPTNT {background_color} {foreground_color} [S]
where {background_color} and {foreground_color} are chosen from
the list given above for the VPCLS command. With fast computers
and video display cards, you may wish to slow down the screen
clearing process to make it more visible. If the optional S
parameter is included, the screen is cleared in 'slow' mode.
With slow mode, the screen is cleared over a time span of about 2
seconds, compared to the fractions of a second required for fast
mode.
For example:
VPTNT 1 14
will quickly 'explode' the screen to yellow on blue.
VPTNT 2 7 S
will slowly 'explode' the screen to white on green.
For maximum explosive effect with VPTNT, we recommend that you
use fast mode.
If no parameters are specified on the command line, VPTNT will
display a summary of its syntax and options.
VPBH.COM
The second visual effect is VPBH, which will clear the screen
with a 'black hole' implosion effect (i.e. any existing text on
the screen seems to be sucked in to the center of the screen).
The syntax is:
VPBH {background_color} {foreground_color} [S]
23
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
where {background_color} and {foreground_color} are chosen from
the list given above for the VPCLS command. With fast computers
and video display cards, you may wish to slow down the screen
clearing process to make it more visible. If the optional S
parameter is included, the screen is cleared in 'slow' mode.
With slow mode, the screen is cleared over a time span of about 2
seconds, compared to the fractions of a second required for fast
mode.
For example:
VPBH 1 14
will quickly 'implode' the screen to yellow on blue.
VPBH 2 7 S
will slowly 'implode' the screen to white on green.
If no parameters are specified on the command line, VPBH will
display a summary of its syntax and options.
VPAT.COM
Without using a special device driver like ANSI.SYS, DOS cannot
print a message at a user selected spot on the screen. This
makes it very difficult to build windowed menus and other types
of display screens which require text to be printed at a specific
location on the screen. Even with ANSI.SYS installed, you are
limited to printing on the currently displayed screen page. VPAT
wil print a text string at a specified location on any video
page. The syntax is:
VPAT {video_page} {background_color} {foreground_color}
{row} {column} {text}
where:
{video_page} is the display page to be printed on (0 only for
the MDA, 0 to 3 for the CGA, 0 to 7 for the EGA or
VGA);
{background_color} and {foreground_color} are the screen colors
to use. The values are given above for the
description of VPCLS;
{row} is the screen row (line) to print on. Rows 0 to
24 are supported on all display adpators. Special
video modes (like 50 line VGA mode) have other
maximum values.
24
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
{column} is the screen column to start printing at.
Columns 0 to 79 are supported on all display
adpators. Special video modes (like 130 colum VGA
mode) have other maximum values.
{text} is the text string to be printed. It can be up to
about 100 characters long (although with the
screen width limitation of most video modes, i.e.
80 columns, it will normally be much less) and can
contain any printable character. Embedded spaces
are allowed, but leading spaces are automatically
removed. Uppercase and lowercase characters are
preserved.
Note: If {text} is longer than the amount of space remaining on
the chosen screen line, it will 'wrap' around to the next screen
line starting at the column specified by the {column} parameter.
For example:
VPAT 1 2 15 10 20 Hello !!
will print the text "Hello !!" on video page 1, starting at line
10, column 20 in bright white letters on green.
VPAT 0 1 14 10 70 This is a long line
will print the text "This is a" on line 10 starting at column 70,
followed by "long line" on line 11, starting at column 70.
If no parameters are specified on the command line, VPAT will
display a summary of its syntax and options.
VPBOX.COM
It is often desirable to 'frame' messages and text in a box on
the screen to make it stand out (or to produce a series of
'windows'). VPBOX draws a box of a given size at a given
location on the screen. It is typically used prior to VPAT to
create message windows on a screen. The syntax is:
VPBOX {video_page} {background_color} {foreground_color}
{style} {top_line} {bot_line} {left_col}
{right_col}
where:
{video_page} is the display page to create the box on (0 only
for the MDA, 0 to 3 for the CGA, 0 to 7 for the
EGA or VGA);
25
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
{background_color} and {foreground_color} are the screen colors
to use. The values are given above for the
description of VPCLS;
{style} is the type of line to draw around the box, as
given in the table below. A total of 26 line
styles are supported. Styles 0 to 8 are lines in
the normal sense, while styles 9 to 25 are borders
composed of various specialty characters.
{top_line} is the screen line (row) for the top of the box.
Lines 0 to 24 are supported on all display
adpators. Special video modes (like 50 line VGA
mode) have other maximum values.
{bot_line} is the screen line for the bottom of the box.
Lines 0 to 24 are supported on all display
adpators. Special video modes (like 50 line VGA
mode) have other maximum values. {bot_line} must
be greater than {top_line}.
{left_col} is the screen column for the left side of the box.
Columns 0 to 79 are supported on all display
adpators. Special video modes (like 130 colum VGA
mode) have other maximum values.
{right_col} is the screen column for the right side of the
box. Columns 0 to 79 are supported on all display
adpators. Special video modes (like 130 colum VGA
mode) have other maximum values. {right_col} must
be greater than {left_col}.
Note: Unpredictable results (i.e. scrambled screen images) will
occur if the line and column parameters are beyond the rage
normally supported by your video adaptor.
26
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
Table 2: Border Styles
----------------+---------------------------------
Box Style Line Type
----------------+---------------------------------
0 no lines
1 thin single lines
2 thin double lines
3 single horizontal, double vertical
4 double horizontal, single vertical
5 thick solid lines
6 light checkered thick lines
7 medium checkered thick lines
8 dark checkered thick lines
9 smiling face
10 reverse smiling face
11 heart
12 diamond
13 club
14 spade
15 dot
16 reverse dot
17 circle
18 reverse circle
19 sinlge musical note
20 double musical note
21 sun
22 square
23 small circle
24 medium dot
25 small dot
----------------+---------------------------------
For example:
VPBOX 0 4 7 1 7 20 4 54
will draw a single lined box on video page 0, white on red, with
the top left at row 7, column 4 and the bottom right at row 20,
column 54.
Overlapping boxes can be created by using multiple VPBOX
commands. The most recently issued VPBOX command will be the top
layer. For example, the following sequence will create a blue on
white window with a black 'shadow' from 2 VPBOX commands:
VPBOX 0 0 0 0 5 20 20 40
VPBOX 0 1 7 1 6 21 21 41
If no parameters are specified on the command line, VPBOX will
display a summary of its syntax and options.
27
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
SECURITY AND DIAGNOSTIC UTILITIES
An increasing number of computers in business and educational
environments are being interconnected through Local Area Networks
(LAN's) and Wide Area Networks (WAN's). Although this
interconnection offers many advantages, it also offers some
disadvantages, namely: data security concerns and access to
system level resources.
Many area network administrators prefer to keep users totally
isolated from the DOS command line. All programs and data are
accessed through established network menu systems, which are
controlled by the network administrator. However, one of the
main security concerns occurs before a user is connected or
logged in to the network. Each workstation usually contains a
hard disk and perhaps even one or more floppy drives. If the
user chooses not to log into the network, they usually have full
access to whatever is stored on these devices.
The two security programs included in the Utility_Belt collection
can be used to keep casual observers away from the DOS command
line in these types of situtations. Note that, as with any
security system, it is far from being unbreakable, but it is
usually sufficient to keep out all casual snoop and scare off a
good many determined hackers as well.
HANG.COM
As its name implies, HANG will simply lockup the computer, and
require a cold reset (i.e. power off, then power on) to restart
the system. The syntax is:
HANG [/Q;] {message}
where:
{message} is a text message to be displayed on the screen while
it is locked up. It can be up to about 120 characters
long (although with the screen width limitation of
most video modes, i.e. 80 columns, it will normally be
much less) and can contain any printable character.
Embedded spaces are allowed, but leading spaces are
automatically removed. Uppercase and lowercase
characters are preserved.
/Q; specifies the optional 'quiet' mode. If /Q is NOT
used, an alarm tone will also be sounded during the
lockup.
28
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
For example:
HANG /Q; Security Violation
will lockup the computer while displaying the message "Security
Violation" on the screen.
HANG Security Violation
will lockup the computer while displaying the message "Security
Violation" on the screen and sounding an audio alarm tone.
HANG may be used as part of a network login procedure such as:
@ECHO OFF
REM === Use your own standard login procedure or command
LOGIN
REM === Check for Login Error
IF ERRORLEVEL 1 GOTO HANG
REM === Exit normally if successful
GOTO END
REM === Otherwise, lockup
:HANG
HANG Security Violation - Network Access Denied
:END
If no parameters are specified on the command line, HANG will
display a summary of its syntax and options.
REBOOT.COM
REBOOT will perform a software controlled re-booting of the
computer. The syntax is:
REBOOT {message} or
REBOOT /N
where:
{message} is a text message to be displayed on the screen before
rebooting. It can be up to about 120 characters long
(although with the screen width limitation of most
video modes, i.e. 80 columns, it will normally be much
less) and can contain any printable character.
Embedded spaces are allowed, but leading spaces are
automatically removed. Uppercase and lowercase
characters are preserved.
29
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
/N specifies the optional 'no wait' mode. If /N is used,
reboot is immediate without displaying any message.
For example:
REBOOT Resetting the computer ... Please Wait
will display the message "Resetting the computer ... Please
Wait", then re-boot the computer after a short delay.
REBOOT may be used as part of a network login procedure such as:
@ECHO OFF
REM === Use your own standard login procedure or command
LOGIN
REM === Check for Login Error
IF ERRORLEVEL 1 GOTO REBOOT
REM === Exit normally if successful
GOTO END
REM === Otherwise, lockup
:REBOOT
REBOOT Security Violation - Network Access Denied
:END
REBOOT can also be used to change the system configuration by
keeping multiple copies of the AUTOEXEC.BAT or CONFIG.SYS files.
For example, if you had several different AUTOEXEC.BAT or
CONFIG.SYS files with different drivers, or memory
configurations, etc., you could use a short batch file menu to
select which one you wanted. For example:
REM === SELAUTO.BAT
@ECHO OFF
REM === SELECT startup mode
SELECT Startup Options; WINDOWS; DOS; NETWORK
IF ERRORLEVEL 3 GOTO NETWORK
IF ERRORLEVEL 2 GOTO DOS
IF ERRORLEVEL 1 GOTO WINDOWS
GOTO END
REM === COPY correct files to AUTOEXEC.BAT and CONFIG.SYS
:WINDOWS
COPY AUTOEXEC.WIN AUTOEXEC.BAT
COPY CONFIG.WIN CONFIG.SYS
GOTO BOOT
:DOS
COPY AUTOEXEC.DOS AUTOEXEC.BAT
COPY CONFIG.DOS CONFIG.SYS
GOTO BOOT
:NETWORK
30
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
COPY AUTOEXEC.NET AUTOEXEC.BAT
COPY CONFIG.NET CONFIG.SYS
REM === Reboot the using new AUTOEXEC and CONFIG files
:BOOT
REBOOT Setting up system configuration ... Please wait
:END
If no parameters are specified on the command line, REBOOT will
display a summary of its syntax and options.
WHATIS.COM
Many different device drivers and configuration programs exist
that can modify the way the operating system interfaces with the
hardware. Usually, things work OK, but when problems occur on a
system, it is often difficult to figure out who is saying what to
whom. When it comes to disk drives (floppy disks, hard disks,
etc) both local, and shared network resources, WHATIS will tell
you what the various components of the operating system are
reporting to each other. The syntax is:
WHATIS {logical_drive}
where {logical_drive} is the drive letter assigned to the logical
device. For example:
WHATIS A
will report the physical and logical parameters associated with
drive A:, as reported by the various DOS and BIOS routines. A
number of parameters are checked and reported, such as:
- total number of floppy drives on system as reported by the
BIOS equipment list word at 0040:0010
- physical device number used by the BIOS disk interrupt 13 to
address the device
- type of device (i.e. 360k, 1.2 meg, hard disk, etc) as
reported by the BIOS (usually from the CMOS RAM) and DOS
(usually from device drivers). Normally these are the same,
but may be different if a device driver is being used.
- whether the device is local or remote (i.e. a network drive)
- whether the media is removable
31
Utility_Belt v1.1a Users' Guide
--------------------------------------------------------------
- whether the device is 'shared' with another logical drive
- if a hard disk or network drive, the size of the drive and
amount of free space available.
If no parameters are specified on the command line, WHATIS will
display a summary of its syntax and options.
32